//
// Created by 束庆乐 on 2024/12/31.
//
#include "iostream"
using namespace std;

class Person{
    //全局函数做友元
    friend ostream& operator<<(ostream& out,Person& p);
private:
    int ma;
    int mb;
public:
    Person(int a,int b){
        this->ma = a;
        this->mb = b;
    }
};

//全局函数实现左移重载
//osteam对象只能有一个
//很像java的toString方法
ostream& operator<<(ostream& out,Person& p){
    out << "a:" << p.ma << " b:" << p.mb;
    return out;
}

void test(){
    Person p(10,20);
    cout << p << endl;
}

int main073(){
    test();

    return 0;
}